
  <template>
  <div>
    <h3>这是新品页面</h3>

    <ul class="detail">
      <li v-for="item in list" :key="item.id">
        <img :src="item.list_pic_url" alt="" width="150px" height="150px" />
        <p>{{ item.name }}</p>
        <p>¥{{ item.retail_price }}</p>
      </li>
    </ul>

    <div class="null"></div>
  </div>
</template>
<script>
import { goodsList } from "@/api/home/newgoods";
export default {
  data() {
    return {
      current: "",
      list: [],
    };
  },
  computed: {},
  created() {
    this.current = this.$route.query.id;
    this.init();
  },
  mounted() {
    var map = new AMap.Map("container");
  },
  methods: {
    init() {
      var obj = {
        isHot: "",
        isNew: "",
        order: "",
      };
      if (this.current == 1) {
        obj.isNew = 1;
      } else {
        obj.isHot = 1;
      }
      goodsList(obj).then((res) => {
        console.log(res);
        this.list = res.data.data;
      });
    },
  },
};
</script>

<style scoped lang='scss'>
.detail {
  display: flex;
  flex-wrap: wrap;
  li {
    width: 186px;
    height: 238px;
    p:nth-child(3) {
      text-align: center;
      font-size: 0.4rem;
      color: #b4282d;
    }
  }
}

.null {
  width: 100%;
  height: 100px;
}
</style>
